package com.caits.lbs.framework.bean.common;

import java.io.Serializable;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 接口传入参数结构定义类
 * @author Lei
 * @param <T>
 */
public class ApiParam<T> implements Serializable {
	private static final long serialVersionUID = 1L;

	private Head head; // 消息头

	private T body; // 业务参数

	private String sign; // 签名字符串

	public Head getHead() {
		return head;
	}

	public void setHead(Head head) {
		this.head = head;
	}

	public T getBody() {
		return body;
	}

	public void setBody(T body) {
		this.body = body;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	@Override
	public String toString() {
		// 使用ToStringBuilder,覆盖对象的toString()方法
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

	/**
	 * http交互公共的接口参数头
	 */
	public static class Head implements Serializable {
		private static final long serialVersionUID = 1L;
		/** 变量:流水号,类型:String */
		private String sequenceCode = "";
		/** 变量:请求时间,类型:String */
		private String requestTime;
		/** 变量:客户端app版本,类型:String */
		private String appVersion;
		/** 变量:协议版本,类型:String */
		private String protocolVersion;
		/** 变量:客户端发送请求的系统类型,类型:String */
		private String callType = "IOS";
		/** 变量:客户端系统版本号,类型:String */
		private String systemVersion = "";
		/** 变量:手机型号,类型:String */
		private String mobileModel = "";
		/** 变量:会话id,类型:String */
		private String token = "";
		/** 变量:大卡中心id,类型:String */
		private String userId = "";
		/** 变量:业务id,类型:String */
		private String bizId;

		/**
		 * FIXME
		 * @return
		 * @return 返回String
		 */
		public String getSequenceCode() {
			return sequenceCode;
		}

		public void setSequenceCode(String sequenceCode) {
			this.sequenceCode = sequenceCode;
		}

		public String getRequestTime() {
			return requestTime;
		}

		public void setRequestTime(String requestTime) {
			this.requestTime = requestTime;
		}

		public String getProtocolVersion() {
			return protocolVersion;
		}

		public void setProtocolVersion(String protocolVersion) {
			this.protocolVersion = protocolVersion;
		}

		public String getAppVersion() {
			return appVersion;
		}

		public void setAppVersion(String appVersion) {
			this.appVersion = appVersion;
		}

		public String getMobileModel() {
			return mobileModel;
		}

		public void setMobileModel(String mobileModel) {
			this.mobileModel = mobileModel;
		}

		public String getSystemVersion() {
			return systemVersion;
		}

		public void setSystemVersion(String systemVersion) {
			this.systemVersion = systemVersion;
		}

		public String getToken() {
			return token;
		}

		public void setToken(String token) {
			this.token = token;
		}

		public String getUserId() {
			return userId;
		}

		public void setUserId(String userId) {
			this.userId = userId;
		}

		@Override
		public String toString() {
			return "Head [sequenceCode=" + sequenceCode + ", requestTime=" + requestTime + ", protocolVersion=" + protocolVersion + ", appVersion=" + appVersion + ", mobileModel="
					+ mobileModel + ", systemVersion=" + systemVersion + ", token=" + token + ", userId=" + userId + "]";
		}

		/**
		 * 获取属性 callType的值
		 * @return the callType : String
		 */
		public String getCallType() {
			return callType;
		}

		/**
		 * 设置属性callType的值，参数类型String
		 * @param callType the callType to set
		 */
		public void setCallType(String callType) {
			this.callType = callType;
		}

		/**
		 * 获取属性 bizId的值
		 * @return the bizId : String
		 */
		public String getBizId() {
			return bizId;
		}

		/**
		 * 设置属性bizId的值，参数类型String
		 * @param bizId the bizId to set
		 */
		public void setBizId(String bizId) {
			this.bizId = bizId;
		}

	}

}